package com.ccrfid.rmc6.repository.business.nightPatrol;

import com.ccrfid.rmc6.entity.business.nightpatrol.NpGroupMemberEntity;
import org.springframework.data.repository.Repository;

import java.util.List;

public interface NpGroupMemberRepository extends Repository<NpGroupMemberEntity, Long> {

    NpGroupMemberEntity getById(Long id);

    List<NpGroupMemberEntity> getAllBy();

    List<NpGroupMemberEntity> getByGroupId(Long groupId);

    NpGroupMemberEntity save(NpGroupMemberEntity npGroupMemberEntity);

    boolean existsById(Long id);

    boolean existsByGroupIdAndPersonnelId(Long groupId, Long personnelId);

    boolean existsAllByGroupId(Long groupId);

    void deleteById(Long id);

    void deleteAllByGroupIdAndPersonnelId(Long groupId, Long personnelId);

    void deleteAllByGroupId(Long groupId);

    void deleteByGroupIdAndPersonnelId(Long groupId, Long personnelId);
}
